package com.heima.userbehavior.controller;

import com.heima.model.behavior.dtos.LikeDto;
import com.heima.model.behavior.dtos.behaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.userbehavior.service.BehaviorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @创建人: stone
 * @描述:
 */
@RestController
@RequestMapping("/api/v1")
@Slf4j
public class BehaviorController {

    @Autowired
    private BehaviorService behaviorService;

    @PostMapping("/likes_behavior")
    public ResponseResult likesBehavior(@RequestBody behaviorDto dto) {
        return behaviorService.likesBehavior(dto);
    }

    @PostMapping("/read_behavior")
    public ResponseResult readBehavior(@RequestBody behaviorDto dto) {
        return behaviorService.readBehavior(dto);
    }

    @PostMapping("/un_likes_behavior")
    public ResponseResult unLikesBehavior(@RequestBody LikeDto dto) {
        return behaviorService.unLikesBehavior(dto);
    }

}
